/**********************************************************
    COPYRIGHT
        KND, Inc. (c) 2011
    CLASS NAME
        platform_timer.c
    DEPENDENCY

    HISTORY
		09/09/2011, created by Guangxing Liu
**********************************************************/
#include "platform_timer.h"
#include "platform_uart.h"

volatile platform_timer_counter uart0_timer;
volatile platform_timer_counter uart1_timer;
volatile platform_timer_counter uart2_timer;
volatile platform_timer_counter uart3_timer;

/************************************************************************
	FUNCTION NAME : platform_timer_init
	INPUTS: 
		none
	OUTPUTS:	
		none
	DESCRIPTION:	
		Platform tiner init
************************************************************************/

void platform_timer_init(void)
{
	
}

/************************************************************************
	FUNCTION NAME : platform_uart_recv_data
	INPUTS: 
		unsigned char uart_port
	OUTPUTS:	
		none
	DESCRIPTION:	
		Platform uart recv data
************************************************************************/

void platform_uart_timer_counter(platform_timer_counter *uart_timer,platform_uart_buffer * uart_recv_buffer)
{
	if(uart_timer->start)
	{
		if(++uart_timer->counter >= uart_timer->counter_timeout)
		{
			if(uart_recv_buffer)
			{
				uart_recv_buffer->finish = TRUE;

				uart_timer->start = FALSE;

				uart_timer->counter = 0;		

				CLR_UART_LED;
				
			}
		}
	}

}






















































